<template>
  <image :src="url" @tap="previewImage(url)" mode="widthFix"></image>
</template>

<script lang="ts" setup>
import {usePreview} from "../../utils/usePreview";
import {onLoad} from "@dcloudio/uni-app";
import {ref} from "vue";
const {previewImage} = usePreview()
const url = ref('')
const BASE_URL = import.meta.env.VITE_PIC_URL

onLoad((options: any) => {
  if (options.DZGZ){
    url.value = `${BASE_URL}/browse?picfilename=${options.DZGZ}`
  }else {
    uni.showToast({
      title: '获取电子公章错误',
      icon: 'none',
      mask: true
    })

    setTimeout(() => {
      uni.navigateBack()
    },500)
  }
})
</script>

<style scoped>
image{
  width: 100vw;
}
</style>
